package com.wyzz.hr.pojo.base;

import java.io.Serializable;

import com.wyzz.hr.pojo.AuthorityPos;
import com.wyzz.hr.pojo.Department;
import com.wyzz.hr.pojo.Location;
import com.wyzz.hr.pojo.Position;

public abstract class BaseAuthorityPos implements Serializable {

	public BaseAuthorityPos() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseAuthorityPos(String id) {
		hashCode = 0x80000000;
		setId(id);
		initialize();
	}

	public BaseAuthorityPos(String id, Position apPos, String apModule,
			String apAuthValidate) {
		hashCode = 0x80000000;
		setId(id);
		setApPos(apPos);
		setApModule(apModule);
		setApAuthValidate(apAuthValidate);
		initialize();
	}

	protected void initialize() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		hashCode = 0x80000000;
	}

	public String getApModule() {
		return apModule;
	}

	public void setApModule(String apModule) {
		this.apModule = apModule;
	}

	public String getApAuthValidate() {
		return apAuthValidate;
	}

	public void setApAuthValidate(String apAuthValidate) {
		this.apAuthValidate = apAuthValidate;
	}

	public Department getApDept() {
		return apDept;
	}

	public void setApDept(Department apDept) {
		this.apDept = apDept;
	}

	public Position getApPos() {
		return apPos;
	}

	public void setApPos(Position apPos) {
		this.apPos = apPos;
	}

	public Location getApLoc() {
		return apLoc;
	}

	public void setApLoc(Location apLoc) {
		this.apLoc = apLoc;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof AuthorityPos))
			return false;
		AuthorityPos authorityPos = (AuthorityPos) obj;
		if (null == getId() || null == authorityPos.getId())
			return false;
		else
			return getId().equals(authorityPos.getId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public static String REF = "AuthorityPos";
	public static String PROP_AP_AUTH_VALIDATE = "apAuthValidate";
	public static String PROP_AP_DEPT = "apDept";
	public static String PROP_AP_POS = "apPos";
	public static String PROP_AP_MODULE = "apModule";
	public static String PROP_ID = "id";
	public static String PROP_AP_LOC = "apLoc";
	private int hashCode;
	private String id;
	private String apModule;
	private String apAuthValidate;
	private Department apDept;
	private Position apPos;
	private Location apLoc;

}
